Finding Text

Both the Code and Hex editors support full string searching. Using the Find dialog box you can search for literal text strings, use regular expressions to find varying words or characters, and even search for binary data using hex ASCII codes.

To find a text string

  1. Move the cursor to the point where you want to begin your search.

  2. From the Edit menu, select Find

  3. In the Find What box, enter the search text or regular expression

  4. Select the appropriate search options

  5. Click Find Next, Find All or Mark All

When the selected text has been found, you have the following options; click Find Next to highlight the next occurrence of the find text, click Find All to list every occurrence of the find text in the Find output window, or click Mark All to add a bookmark to each line that contains the find text.

To cancel the search and return the input focus to the code editor, press Cancel. You can continue to find text matching the criteria and options specified even after closing the Find dialog. Using Find Next (F3) and Find Previous (Shift+F3), you can continue a previous find although the direction is specified by the command selected; Next, downwards, or Previous, upwards.

Tip

The find and replace dialog boxes use the currently selected text in the code editor as the initial criteria in the Find what box. If there is no selection, the word at the current insertion point is used. Clicking the down arrow to the right of the Find what box displays the previous criteria used.

Search Options

By default, Programmer Studio searches the entire file in the code editor for text matching the criteria specified. The search options can be used to alter how text is matched.

Match Whole Word Only

Find whole words and not sub-strings inside words. For example, help and not helping.

When editing source code, the keyword definition in the language settings is used to determine which characters are word characters. For example, the C language definition includes underscore and pound characters in addition to A-Z and 0-9.

Match Case

Find words matching the case of the text in the Find what box. For example help and not HELP.

Regular Expression

Find text matching a specified pattern that varies between occurrences. For example, f.r will match any three letter text string beginning with an f and ending in an r. For more information see Using Regular Expressions.

Clicking the arrow button to the right of the Find What field displays a popup menu of regular expression arguments. Selecting an item from this menu will automatically add the correct arguments to the current search criteria.

Note

If the Regular Expression search option is selected, the Match Whole Word Only option is ignored..

Hex Expression

When specified, the search criteria can be expressed as in hex format. Each hex character must be specified as \x followed by the hex value of the ASCII character to search for. For example, \x20\x41 will match each occurrence of a space followed by the letter A.

For more information on ASCII character values, see Appendix B, ASCII Character Set.

Wrap Search Direction

Continue the search after reaching the start or end of the file (depending upon the initial search direction) to search the entire file.